-- doping
-- created by zhuangsl
-- 兴奋剂

return {
    fetchProps = function(who, status, condition)
        local props  = {};
        local propId = PropM.getPropId("attrib3");
        local value  = condition["value"];
        local endRound = condition["end_round"];

        -- 攻击提升
        table.insert(props, { propId, "attack", value, endRound, });

        -- 降低所受伤害
        propId = PropM.getPropId("damage");
        value  = tonumber(condition["damage_reduce"]);
        if value > 0 then
            table.insert(props, { propId, "attack", value, endRound, });
        end

        return props;
    end,

    desc = function(who, status, condition)
        -- 获取状态描述
        local cfg = CombatStatusM.getStatusInfo(status);
        local desc = cfg.desc;

        -- 降低所受伤害
        local value  = tonumber(condition["damage_reduce"]);
        if value > 0 then
            desc = cfg.extra_desc;
            value = math.modf(value / 10);
            desc = string.gsub(desc, "{damage_reduce}", value);
        end

        -- 效果
        value = condition["value"];
        desc = string.gsub(desc, "{value}", value);

        return desc;
    end,
};
